<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box-wrapper {
            width: 800px;
            height: 200px;
        }

        .box {
            float: left;
            width: 200px;
            height: 200px;
            line-height: 200px;
            text-align: center;
            color: #fff;
            font-size: 30px;
        }

        .box1 {
            background-color: green;
        }

        .box2 {
            background-color: orange;
        }

        .box3 {
            background-color: red;
        }

        .box4 {
            background-color: blue;
        }
    </style>
</head>

<body>
    <div id="app">
        <div class="box-wrapper">
            <div class="box box1" v-if="boxShow1">BOX 1</div>
            <div class="box box2" v-show="boxShow2">BOX 1</div>
            <div class="box box3" v-if="boxShow3">BOX 3</div>
            <div class="box box4" v-show="boxShow4">BOX 4</div>

        </div>
        <button @click="showBox1"> BOX 1</button>
        <button @click="showBox2"> BOX 2</button>
        <button @click="showBox3"> BOX 3</button>
        <button @click="showBox4"> BOX 4</button>

      
    </div>
    <script src="xiaoye.js"></script>
    <script>
        new Xiaoye({
            el: '#app',
            data: {
                boxShow1: false,
                boxShow2: false,
                boxShow3: false,
                boxShow4: false
            },
            methods: {
                showBox1() {
                    console.log(this)
                    this.boxShow1 = !this.boxShow1
                },
                showBox2() {
                    console.log('click box 2')
                    this.boxShow1 = !this.boxShow2
                }
                ,
                showBox3() {
                    console.log('click box 3')
                    this.boxShow3 = !this.boxShow3
                }
                ,
                showBox4() {
                    console.log('click box 4')
                    this.boxShow4 = !this.boxShow4
                }
            }
        })
    </script>
</body>

</html>